# build C++ dev environment based on ubuntu 20.04
FROM ubuntu:20.04

RUN apt update

# install Python dev tools
RUN apt install -y vim git git-lfs net-tools
RUN apt install -y python3.12 python3.12-pip

# install oh-my-zsh
RUN apt -y install zsh
COPY ../scripts/install-omz.sh /install-omz.sh
RUN sh /install-omz.sh
RUN git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
RUN git clone https://gitee.com/Annihilater/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
RUN sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="steeef"/g' ~/.zshrc
RUN sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/g' ~/.zshrc
RUN chsh -s /bin/zsh

# install ssh server
RUN apt install -y openssh-server
RUN mkdir /var/run/sshd && mkdir /root/.ssh
RUN echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
RUN echo "root:123456" | chpasswd
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]